/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.meego.common.io.image;

import com.meego.common.queue.QueueCommand;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;

/**
 *
 * @author TueHM
 */
public class ImageResize implements QueueCommand {

    BufferedImage image;
    String module;
    String fileName;

    public ImageResize(File image, String module) throws IOException {
        this.image = ImageIO.read(image);
        this.fileName = image.getName();
        this.module = module;
    }

    @Override
    public void execute() {
        int type = image.getType() == 0 ? BufferedImage.TYPE_INT_ARGB : image.getType();

//        BufferedImage resizeImageJpg = resizeImage(originalImage, type);
//        ImageIO.write(resizeImageJpg, "jpg", new File("c:\\image\\mkyong_jpg.jpg"));
//
//        BufferedImage resizeImagePng = resizeImage(originalImage, type);
//        ImageIO.write(resizeImagePng, "png", new File("c:\\image\\mkyong_png.jpg"));
//
//        BufferedImage resizeImageHintJpg = resizeImageWithHint(originalImage, type);
//        ImageIO.write(resizeImageHintJpg, "jpg", new File("c:\\image\\mkyong_hint_jpg.jpg"));
//
//        BufferedImage resizeImageHintPng = resizeImageWithHint(originalImage, type);
//        ImageIO.write(resizeImageHintPng, "png", new File("c:\\image\\mkyong_hint_png.jpg"));

        throw new UnsupportedOperationException("Not supported yet.");
    }
}
